<?php

/**
 * nosotros form.
 *
 * @package    istmo
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class nosotrosForm extends BasenosotrosForm {

    public function configure() {
        $this->widgetSchema['texto'] = new sfWidgetFormTextareaTinyMCE(array(
            'width' => 550,
            'height' => 350,
            'config' => 'theme_advanced_disable: "anchor,image,cleanup,help"',
        ));

        $imagen = '/uploads/contenidos/nosotros/' . $this->getObject()->imagen;

        $this->widgetSchema['imagen'] = new sfWidgetFormInputFileEditable(array(
            'label' => 'Imagen',
            'file_src' => $imagen,
            'is_image' => true,
            'edit_mode' => !$this->isNew(),
            'template' => '<style>.fix img{max-width:200px; display:block;}</style><div class="fix">%file%</div><br />%input%<br />',
            'delete_label' => 'Borrar imagen'));

        $this->validatorSchema['imagen'] = new sfValidatorFile(array(
            'required' => $this->isNew(),
            'path' => sfConfig::get('sf_upload_dir') . '/contenidos/nosotros/',
            'mime_types' => 'web_images',
        ));
    }

}
